<template>
  <div class="about">
    <v-sidebar @handleSelect="handleSelect" />
    <v-header />
    <!--  v-if="isAuth == 2" -->
    <!-- <v-sidebar :isAuth="isAuth" v-if="isAuth != 0 && isAuth != -1" /> -->
    <div class="content-box" :class="{ 'content-collapse': collapse }">
      <!-- <tablist /> -->
      <!-- <v-tags></v-tags> -->
      <div class="content">
        <router-view v-slot="{ Component }" :key="$route.fullPath">
          <transition name="move" mode="out-in">
            <keep-alive :include="tagsList">
              <component :is="Component" />
            </keep-alive>
          </transition>
        </router-view>
        <!-- <el-backtop target=".content"></el-backtop> -->
      </div>
    </div>
    <div class="positionTop lineHeight text-align bottom—name toptitle">
      <span @click="handleHaXi"> 技术支持： 厦门哈希科技有限公司</span>
      <img style="height:20px;width:20px;margin:0 10px;position: relative;top:3px;" src="../assets/img/record.png" />
      <a href="https://beian.miit.gov.cn/" target="_blank">{{ servePlatform == 5 ? '蜀ICP备2022026667号-1' : '闽ICP备18008864号'
      }}</a>
    </div>
  </div>
</template>
<script>
import { computed } from "vue";
import { useStore } from "vuex";
import vHeader from "../components/Header.vue";
import tablist from "../components/tab_list.vue";
import vTags from "../components/Tags.vue";
import vSidebar from "../components/Sidebar.vue";
import { ElLoading } from "element-plus";
import api from "../api/api";
import { ref, reactive } from "vue";
import getuserinfo from "../api/getuserinfo";
import router from "../router";
export default {
  components: {
    vHeader,
    tablist,
    vTags,
    vSidebar,
  },
  setup() {
    const store = useStore();
    const tagsList = computed(() =>
      store.state.tagsList.map((item) => item.name)
    );
    //servePlatform == 1为测试服  servePlatform ==2电信(盈江)
    // servePlatform ==3 正式 servePlatform ==4 包头 servePlatform ==5 巴中
    const servePlatform = ref(api.servePlatform());
    const detail = ref(null);
    const isContent = ref(true);
    // getuserinfo.getuserInfo();
    const userInfojson = localStorage.getItem("userInfo");
    const userInfo = JSON.parse(userInfojson);
    const isAuth = ref(null);
    if (userInfo) {
      isAuth.value = userInfo.IsAuth;
    }
    const collapse = computed(() => store.state.collapse);
    const handleSelect = (event) => {
      console.log(event)
      if (event.indexOf("offset_record") != -1) {
        router.replace(event);
      } else if (event.indexOf("/CarbonTicket") != -1) {
        router.replace(event);
      }
    };
    const handleHaXi = () => {
      window.open("http://www.zlinkchain.com/contents/183/1109.html", "_block");
    }
    return {
      tagsList,
      collapse,
      detail,
      isContent,
      isAuth,
      servePlatform,
      handleSelect, handleHaXi
    };
  },
};
</script>
<style lang="less" scoped>
.lineHeight {
  height: 40px;
}

.bottom—name {
  cursor: pointer;
}

.toptitle>a {
  color: #999;
}
</style>
